<template>
  <div class="nav">
    <el-button type="primary" @click="tohome">返回主页</el-button>
    <el-button type="primary" @click="topina">点击{{counterStore.count}}</el-button>
  </div> 
</template>
<script setup>
import { ref, reactive, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useCounterStore } from '../store'
import { useMainStore } from '../store'
import request from "@/request/http";
const router = useRouter();
const route = useRoute();
const data = reactive({
  username:""
});
const counterStore  = useCounterStore()
const user =  useMainStore()
const tohome = () => {
  router.push("/home");
};
const topina = ()=>{
  counterStore.increment()
}
onMounted(() => {
  console.log(route.query.id);
  data.username = counterStore.count;
  console.log(data.username)
  console.log(user.counter)
});
</script>
<style lang="less" scoped>
.nav {
  width: 100%;
  height: 100%;
  // background: #000;
}
</style>